// import 'babel-polyfill'
import Vue from "vue";
import "lib-flexible";
import App from "./App.vue";
import router from "@/router";
import store from "@/store";
import "utils/permission";
import SvgIcon from "components/SvgIcon";
import "@/icons"; // icon
import "@/style/common.scss";
import { Lazyload } from "vant";
import defaultSettings from "@/settings";

import { Dialog } from "vant";
Vue.use(Dialog);

import "vue-easytable/libs/themes-base/index.css";
import { VTable } from "vue-easytable";
Vue.component(VTable.name, VTable);
/**
 * If you don't want to use mock-server
 * you want to use MockJs for mock api
 * you can execute: mockXHR()
 *
 * Currently MockJs will be used in the production environment,
 * please remove it before going online! ! !
 */
// import { mockXHR } from '../mock'

// if (process.env.NODE_ENV === 'production') {
//   mockXHR()
// }

import filters from "./filters";
Object.keys(filters).map(e => {
  Vue.filter(e, value => {
    return filters[e](value);
  });
});

// options 为可选参数，无则不传
Vue.use(Lazyload);

Vue.component("svg-icon", SvgIcon);

// if (defaultSettings.vconsole) {
//   const VConsole = require("vconsole");
//   // eslint-disable-next-line
//   const my_console = new VConsole();
// }
// var vConsole = new VConsole(option)

Vue.config.productionTip = false;

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount("#app");
